#
#    Copyright (C) 2016 Francisco Javier Parra <franparpe@openmailbox.org>
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
#

from dxfwrite import DXFEngine as dxf

def export_profile_to_dxf(profile, camFileName):
    """It saves a profile to a dxf format

    Keyword Arguments:
    profile -- 
    """
    drawing = dxf.drawing(camFileName)
    drawing.add_layer('0')
    polyline = dxf.polyline(profile, layer='0')
    drawing.add(polyline)
    drawing.save()

def export_profile_and_conj_to_dxf(profile1, profile2, camFileName):
    drawing = dxf.drawing(camFileName)
    drawing.add_layer('0')
    drawing.add_layer('1')
    polyline1 = dxf.polyline(profile1, layer='0')
    polyline2 = dxf.polyline(profile2, layer='1')
    drawing.add(polyline1)
    drawing.add(polyline2)
    drawing.save()
